# l = [1, 12, 1, 2, 2, 3, 5]

# print(list(set(l)))
# new_l = list(set(l))
#
# new_l.sort(reverse=True)
# print(new_l)

# students = [
#     {"name": "Alice", "score": 85},
#     {"name": "Bob", "score": 76},
#     {"name": "Charlie", "score": 90},
#     {"name": "David", "score": 68},
#     {"name": "Eva", "score": 92}
# ]
# print(len(students))
# total = 0
# for i in students:
#     total += i.get("score")
#
# print("total:", total)
# print("average:", round(total / len(students),2))
# max_score = students[0]["score"]
# min_score = students[0]["score"]
# for studentDict in students:
#     score = studentDict.get("score")
#
#     if score > max_score:
#         max_score = score
#
#     if score < min_score:
#         min_score = score
# print(max_score, min_score)

# students = {
#     "Alice": {"math": 85, "english": 90, "history": 78},
#     "Bob": {"math": 76, "english": 82, "history": 88},
#     "Charlie": {"math": 90, "english": 92, "history": 86},
#     "David": {"math": 68, "english": 72, "history": 80},
#     "Eva": {"math": 92, "english": 88, "history": 90}
# }

# for name, stu_score_dict in students.items():
#     # print(name, stu_score_dict)
#     total = 0
#     for sub_score in stu_score_dict.values():
#         total += sub_score
#     print(name, total, round(total / len(stu_score_dict), 2))

# config = {
#     "数据库": {
#         "主机": "localhost",
#         "端口": 3306,
#         "用户名": "admin",
#         "密码": "password"
#     },
#     "服务器": {
#         "IP地址": "192.168.0.1",
#         "端口": 8080,
#         "日志级别": "INFO"
#     }
# }
#
# config["服务器"]["端口"] = 8090
# config["服务器"]["日志级别"] = "DEBUG"
# print(config)
